import { createRouter, createWebHistory } from 'vue-router'
import IndexView from '@/views/index/index.vue'
import ArticleCategoryView from '@/views/ArticleCategory/index.vue'
import AuthorView from '@/views/Author/index.vue'
import ArticleView from '@/views/Articles/index.vue'
import ReportView from '@/views/report/index.vue'
import LoginView from '@/views/login/index.vue'
import LayoutView from '@/views/layout/index.vue'


// 路由配置
const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      name: 'layout',
      component: LayoutView,
      redirect: '/index',
      children: [
    { path: 'index',name: 'index',component: IndexView},
    { path: 'articleCategory',name: 'ArticleCategory',component: ArticleCategoryView},
    { path: 'author',name: 'Author',component: AuthorView},
    { path: 'article',name: 'Article',component: ArticleView},
    { path: 'report',name: 'Report',component: ReportView},
      ]
    },
    { path: '/login',name: 'login',component: LoginView},
  ]
})

export default router
